﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;

using SamuelBlanchard.Extenders;

namespace Techdays2013
{
    public partial class BlankPage : PhoneApplicationPage
    {
        public BlankPage()
        {
            InitializeComponent();

            this.Loaded += TextToSpeechPage_Loaded;
            this.BackKeyPress += TextToSpeechPage_BackKeyPress;
            this.GridFade.Visibility = System.Windows.Visibility.Visible;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void TextToSpeechPage_BackKeyPress(object sender, System.ComponentModel.CancelEventArgs e)
        {
            e.Cancel = true;
            this.GridFade.Visibility = System.Windows.Visibility.Visible;
            this.GridFade.FadeIn((s) => { NavigationService.GoBack(); });
        }

        /// <summary>
        /// On attent sue tout soit mise à jour
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        void TextToSpeechPage_Loaded(object sender, RoutedEventArgs e)
        {
            this.GridFade.FadeOut((s) => { s.Visibility = Visibility.Collapsed; });
        }

        /// <summary>
        /// Bouton pressé
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>

        private void Button_Click_Talk(object sender, RoutedEventArgs e)
        {

        }
    }
}